//  通用单行文本输入界面
//  SinglelineTextFormViewController.m
//  yilutongxing
//
//  Created by T&J on 2017/6/26.
//  Copyright © 2017年 YZE. All rights reserved.
//

#import "SinglelineTextFormViewController.h"

@interface SinglelineTextFormViewController ()
@property (strong, nonatomic) IBOutlet UITextField *contentTextfield;

@end

@implementation SinglelineTextFormViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *leftButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(backAction)];
    self.navigationItem.leftBarButtonItem=leftButtonItem;
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStyleDone target:self action:@selector(confirmAction)];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)backAction{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)confirmAction{
    if (_contentTextfield.text.length==0) {
        return;
    }
    if ([self.delegate respondsToSelector:@selector(backData:identifier:)]) {
        [self.delegate backData:_contentTextfield.text identifier:self.indexPath];
    }
    [self backAction];
}


@end
